package cn.piesat.client.service;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

public class test {
    public static void main(String[] args) {
        String a ="{\n" +
                "  \"algorithmIdentify\": \"FY4BGHIBLD\",\n" +
                "  \"fileTaskID\": \"8a99951f821f7ccc0182205b5f6404b6\",\n" +
                "  \"mainFileName\": \"FY4B-_GHI---_N_REGX_1330E_L1-_FDI-_MULT_NOM_20220721080600_20220721080659_0250M_V0001.HDF\",\n" +
                "  \"preprocess\": false,\n" +
                "  \"productDir\": \"\",\n" +
                "  \"algorithmResultsJson\": \"{\\\"status\\\": 0, \\\"message\\\": \\\"GHI真彩色图像融合算法执行成功，耗时：56.51秒!\\\", \\\"productionTime\\\": \\\"2022-07-21 18:46:47 CST\\\", \\\"result\\\": [{\\\"file\\\": \\\"/mnt/swap2_FY4B/DATA/SWAP/FY4B/GHI/FY4BGHIBLD//2022/20220721/FY4B-_GHI---_N_REGX_1330E_L1-_FDI-_MULT_NOM_20220721080600_20220721080659_0250M_V0001_4425_11633.tiff\\\", \\\"id\\\": \\\"GHIBLD\\\", \\\"type\\\": \\\"R\\\"}]}\",\n" +
                "  \"pathConfigId\": \"8a986d9a8151d405018174b9f5d000c0\",\n" +
                "  \"fileDate\": \"20220721080600\",\n" +
                "  \"hasFlow\": false,\n" +
                "  \"taskId\": \"8a986d9a81c7d04d01821987593706b4\",\n" +
                "  \"algorithmId\": \"8a986d9a81c7d04d01821986a17b06ab\"\n" +
                "}";
        JSONObject jsonObject = JSON.parseObject(a);
        JSONObject algorithmResultsJson = jsonObject.getJSONObject("algorithmResultsJson");
        JSONObject jsonStr = JSON.parseObject(algorithmResultsJson.getString("result").replace("[","").replace("]",""));
        System.out.println(jsonStr.getString("file"));
    }
}
